﻿using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;

namespace MyTanks
{
    public class MyShellAuthoring : MonoBehaviour
    {
        public Vector3 velocity;


        class Baker : Baker<MyShellAuthoring>
        {
            public override void Bake(MyShellAuthoring authoring)
            {
                var entity = GetEntity(TransformUsageFlags.None);
                AddComponent(entity, new Shell()
                {
                    velocity = authoring.velocity,
                    duration = 0
                });
  
                AddComponent(entity, new ShellIsIdle()
                {
                });
            }
        }
    }

    public struct Shell : IComponentData
    {
        public float3 velocity;
        public float duration;
    }

    public struct ShellIsIdle : IComponentData, IEnableableComponent
    {
    }
}